<?php
include_once "../header1.php";
?>
<script type="text/javascript">
function getHttpRequest()
{
if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlhttp;
}
function showHint(str)
{
var xmlhttp;    
if (str=="")
  {
  document.getElementById("List").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
   document.getElementById("List").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","upp_sch_names.php?q="+str,true);
xmlhttp.send();
}
function fill(val)
{
document.form1.SchName.value=val;
document.getElementById("List").innerHTML="";
var xmlhttp;    
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
   document.getElementById("PID").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","pronames.php?q="+val,true);
xmlhttp.send();
}
</script>
<script type="text/javascript">
function getProYear(com)
{
var xmlhttp;  
var sch=document.forms["form1"]["SchName"].value;
var hin=com+","+sch; 
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
   document.getElementById("Pro_year").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","get_Pro_year.php?q="+hin,true);
xmlhttp.send();
}
</script>
<script type="text/javascript">
function getRes(hin)
{
	var xmlhttp;    
if (hin=="")
  {
  document.getElementById("Sea_P_Id").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
   document.getElementById("Sea_P_Id").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getproids.php?q="+hin,true);
xmlhttp.send();
}
</script>
</head>
<body>
<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
require_once '../index.php';
}
   
   else
   {
   if(isset($_POST['SaveChanges']))
   {
   if($_SESSION['Access_Type']=="Teacher in Charge")
{
 $SchName=$_POST['SchName'];
$name=explode(",",$SchName);
$nam=$name[0];
$tn=count($name);
for($i=1;$i<$tn;$i++)
{
if(empty($adr))
{
$adr=$name[$i];
}
else
{
$adr=$adr.",".$name[$i];
}
}
$results= mysql_query("SELECT * FROM school Where Name='$nam' AND Address='$adr'");
if($row = mysql_fetch_array($results))
{
 $School_Id=$row['School_Id'];
}
   $NIC_Number=$_SESSION['NIC_Number'];
   $get_Sch=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$NIC_Number'");
   if($rowsch=mysql_fetch_array($get_Sch))
{
   $Own_School_Id=$rowsch['School_Id'];
  
   if($School_Id==$Own_School_Id)
	{
  require_once 'UPP.php';
   }
   else
	   {
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
   }
   }
else if($_SESSION['Access_Type']=="Administrator")
{
require_once 'UPP.php';
}   
   else
	   {
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
}
    $P_Id="";
	   $S_Id="";
	   $year="";
	   $Grade="";
   if(isset($_POST['Edit_This']))
{
$Pro_Name=$_POST['Pro_Name'];
$resultp= mysql_query("SELECT * FROM programme Where Programme_Name='$Pro_Name'");
if($rowp = mysql_fetch_array($resultp))
{
 $P_Id=$rowp['Programme_Id'];
}

$SchName=$_POST['SchName'];
$name=explode(",",$SchName);
$nam=$name[0];
$tn=count($name);
for($i=1;$i<$tn;$i++)
{
if(empty($adr))
{
$adr=$name[$i];
}
else
{
$adr=$adr.",".$name[$i];
}
}
$results= mysql_query("SELECT * FROM school Where Name='$nam' AND Address='$adr'");
if($row = mysql_fetch_array($results))
{
 $S_Id=$row['School_Id'];
}
	   $year=$_POST['Year'];
	   
	$_SESSION['P_Id']=$P_Id;
	  $_SESSION['S_Id']=$S_Id;
	  $_SESSION['year']=$year;
	  $_SESSION['Grade']=$Grade;
	  if($_SESSION['Access_Type']=="Teacher in Charge")
{
   $NIC_Number=$_SESSION['NIC_Number'];
   $get_Sch=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$NIC_Number'");
   if($rowsch=mysql_fetch_array($get_Sch))
{
   $Own_School_Id=$rowsch['School_Id'];
 if( $Pro_Name=="Select One"||$SchName==""||$year=="Select One"||$Grade=="Select One")
	   {
		    
	$_SESSION['errorin1']="Please select the Programme name,School's name,Grade and Year!";

	   }
	   if($Pro_Name!="Select One"&&$SchName!=""&&$year!="Select One"&&$Grade!="Select One")
	   {
	    if($S_Id==$Own_School_Id)
	{  
	   $result=mysql_query("SELECT * FROM programmes WHERE Programme_Id='$P_Id' AND School_Id='$S_Id' AND Year='$year' AND Grade='$Grade'");
	   if(mysql_num_rows($result)==0)
   {
	   $_SESSION['errornorow']="Very sorry there is no result,Please check your input and try again!";
   }
	   }
	    else
	   {
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
	   }
	   }
	    else
	   {
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
	   }
	   else if($_SESSION['Access_Type']=="Administrator")
{
if( $Pro_Name=="Select One"||$SchName==""||$year=="Select One"||$Grade=="Select One")
	   {		    
	$_SESSION['errorin1']="Please select the Programme name,School's,Grade name and Year!";
	   }
	   if($Pro_Name!="Select One"&&$SchName!=""&&$year!="Select One"&&$Grade!="Select One")
	   {
	  $result=mysql_query("SELECT * FROM programmes WHERE Programme_Id='$P_Id' AND School_Id='$S_Id' AND Year='$year' AND Grade='$Grade'");
	   if(mysql_num_rows($result)==0)
   {
	   $_SESSION['errornorow']="Very sorry there is no result,Please check your input and try again!";
   }
   }
   }
    else
	   {
	   
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
}
   ?>
   <?php

include_once "../header2.php";


?>
<?php
include_once "topmenu.php";
?>
<div id="content">
	<div id="main">
	  <div id="bodyfield">
<div id="lefttable">
<form action="#" method="POST" name="form1">
  <table width="438" border="0" class="tablefontv" >
    <tr>
      <td colspan="9"  scope="row" class="err">
	  <?php
if(isset($_POST['Edit_This'])||isset($_POST['SaveChanges']))
{
if(isset($_SESSION['errornotallo']))
{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
echo $_SESSION['errornotallo'];
unset($_SESSION['errornotallo']);
}
}
?><?php
		if(isset($_POST['Edit_This'])||isset($_POST['SaveChanges']))
{
	if(isset($_SESSION['error']))
	{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo $_SESSION['error'];
		unset($_SESSION['error']);
	}
	if(isset($_SESSION['errorin']))
	{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo $_SESSION['errorin'];
		unset($_SESSION['errorin']);
	}
	if(isset($_SESSION['errorin1']))
	{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo $_SESSION['errorin1'];
		unset($_SESSION['errorin1']);
	}
	if(isset($_SESSION['errornorow']))
	{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo $_SESSION['errornorow'];
		unset($_SESSION['errornorow']);
	}
	
}
		?>
      </td>
      </tr>
    <tr>
      <th width="22" rowspan="4"  scope="row" bgcolor="#6AB5FF">&nbsp;</th>
      <td width="127"  scope="row" bgcolor="#6AB5FF">School's Name:</td>
      <td width="134" bgcolor="#999999">
      <?php
	 	if($_SESSION['Access_Type']=="Teacher in Charge")
{
	$NIC_Number=$_SESSION['NIC_Number'];
   $get_Sch=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$NIC_Number'");
   if($rowsch=mysql_fetch_array($get_Sch))
{
   $Own_School_Id=$rowsch['School_Id']; 
    $snam=mysql_query("SELECT * FROM school WHERE School_Id='$Own_School_Id'");
	  if($ros=mysql_fetch_array($snam))
	  {
	  $SchName=$ros['Name'].','.$ros['Address'];
	  }
}
	 echo "<input type='text' id='SchName' name='SchName' onKeyUp='showHint(this.value)' value='$SchName' size='40' readonly='readonly'/>";
}
	else if($_SESSION['Access_Type']=="Administrator")
{
	if(!isset($SchName))
	{
		$snam=mysql_query("SELECT * FROM school WHERE School_Id='$S_Id1'");
	  if($ros=mysql_fetch_array($snam))
	  {
	  $SchName=$ros['Name'].','.$ros['Address'];
	  }
	}
	    echo "<input type='text' id='SchName' name='SchName' onKeyUp='showHint(this.value)' value='$SchName' size='40'/>";
}
	  ?></td>
      <td width="137" rowspan="6" bgcolor="#6AB5FF">&nbsp;</td>
      
      </tr>
    <tr>
      <td height="22" scope="row" bgcolor="#6AB5FF">Programme Name:</td>
      <td bgcolor="#999999"><div id="PID"><select name="Pro_Name" id="Pro_Name" onChange="getProYear(this.value)">
        <?php
		 $Sch_Id=$_POST['Sch_Id'];	 
	  if(isset($_POST['SaveChanges']))
	  {
	  $P_Id=$_SESSION['Pr_Id'];	 
		unset($_SESSION['Pr_Id']);
	  }
	  if($P_Id!="")
	  {
	    $resultnet=mysql_query("SELECT * FROM programme WHERE Programme_Id='$P_Id'");
  if($rownet=mysql_fetch_array($resultnet))
  {
		$P_Name=$rownet['Programme_Name'];
}
	echo '<option value="'.$P_Name.'">'.$P_Name.'</option>';
	  }
	  else
	  {
	  echo '<option value="Select One">Select One</option>';
	  }
	  ?>
        <?php
	  if($Sch_Id!="")
		{
			$pro=mysql_query("SELECT DISTINCT(Programme_Id) FROM programmes WHERE School_Id='$Sch_Id'");
		}
		if($Sch_Id=="")
		{
	  $pro=mysql_query("SELECT DISTINCT(Programme_Id) FROM programmes");
		}
  while($row=mysql_fetch_array($pro))
  {
	  $p_id=$row['Programme_Id'];
   $resultnet=mysql_query("SELECT * FROM programme WHERE Programme_Id='$p_id'");
  if($rownet=mysql_fetch_array($resultnet))
  {
		$p_Name=$rownet['Programme_Name'];
}
if($p_Name!=$P_Name)
{
	  echo '<option value="'.$p_Name.'">'.$p_Name.'</option>';
	  }
	  echo '<option value="'.$p_Name.'">'.$p_Name.'</option>';
  }
	  ?>
      </select></div></td>
      </tr>
    <tr>
      <td height="26" scope="row" bgcolor="#6AB5FF">Year:</td>
      <td bgcolor="#999999"><div id="Pro_year"><select name="Year" id="select">
        <?php	 
	  if(isset($_POST['SaveChanges']))
	  {
	   $yea=$_SESSION['yea'];
	echo '<option value="'.$yea.'">'.$yea.'</option>';
	unset($_SESSION['yea']);
	  }
	  if(isset($_POST['Edit_This']))
	  {
	echo '<option value="'.$year.'">'.$year.'</option>';
	  }
	  else
	  {
	  echo '<option value="Select One">Select One</option>';
	  }
	  ?>
        <?php
	  $pro=mysql_query("SELECT DISTINCT(Year) FROM programmes");
	  
  while($row=mysql_fetch_array($pro))
  {
	 $year=$row['Year'];

	  echo '<option value="'.$year.'">'.$year.'</option>';
  }
	  ?>
      </select>
      </div></td>
            </tr>
			<tr>
      <td height="26" scope="row" bgcolor="#6AB5FF">Grade:</td>
      <td bgcolor="#999999"><div id="Pro_grade"><select name="Grade" id="select">
        <?php	 
	  if(isset($_POST['SaveChanges']))
	  {
	   $Grade=$_SESSION['Grade'];
	echo '<option value="'.$Grade.'">'.$Grade.'</option>';
	unset($_SESSION['Grade']);
	  }
	  if(isset($_POST['Edit_This']))
	  {
	echo '<option value="'.$Grade.'">'.$Grade.'</option>';
	  }
	  else
	  {
	  echo '<option value="Select One">Select One</option>';
	  }
	  ?>
        <?php
	  $prog=mysql_query("SELECT DISTINCT(Grade) FROM programmes");
	  
  while($rowg=mysql_fetch_array($prog))
  {
	 $Grad=$rowg['YGrade'];

	  echo '<option value="'.$Grad.'">'.$Grad.'</option>';
  }
	  ?>
      </select>
      </div></td>
            </tr>
    <tr>
      <th height="24" colspan="3" bgcolor="#6AB5FF" scope="row"><a href="UpdateProSch.php" class="reset">Reset |</a>
        <input name="Edit_This" align="middle" type="submit" value="Edit this" class="buttonok"/></th>
          </tr>
  </table>
  <br/>
</form>
<form action="#" method="POST">
    <?php 
if(isset($_POST['Edit_This']))
		{
$Pro_Name=$_POST['Pro_Name'];
$name=explode(",",$Pro_Name);
$nam=$name[0];
$tn=count($name);
for($i=1;$i<$tn;$i++)
{
if(empty($adr))
{
$adr=$name[$i];
}
else
{
$adr=$adr.",".$name[$i];
}
}
$resultp= mysql_query("SELECT * FROM programme Where Programme_Name='$Pro_Name'");
if($rowp = mysql_fetch_array($resultp))
{
 $P_Id=$rowp['Programme_Id'];
}
$SchName=$_POST['SchName'];
$name=explode(",",$SchName);
$nam=$name[0];
$tn=count($name);
for($i=1;$i<$tn;$i++)
{
if(empty($adr))
{
$adr=$name[$i];
}
else
{
$adr=$adr.",".$name[$i];
}
}
$results= mysql_query("SELECT * FROM school Where Name='$nam' AND Address='$adr'");
if($row = mysql_fetch_array($results))
{
 $S_Id=$row['School_Id'];
}
	  $year=$_POST['Year'];
	   $Grade=$_POST['Grade'];
	   if( $P_Id!="Select One"&&$SchName!=""&&$year!="Select One"&&$Grade!="Select One")
	   {
	   if($_SESSION['Access_Type']=="Teacher in Charge")
{
   $NIC_Number=$_SESSION['NIC_Number'];
   $get_Sch=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$NIC_Number'");
   if($rowsch=mysql_fetch_array($get_Sch))
{
   $Own_School_Id=$rowsch['School_Id'];
   if($S_Id==$Own_School_Id)
	{  
	$result=mysql_query("SELECT * FROM programmes WHERE Programme_Id='$P_Id' AND School_Id='$S_Id' AND Year='$year' AND Grade='$Grade'");
	if(mysql_num_rows($result)!=0)
	{
	echo '<table width="354" border="0" class="tablefontv">';
	while($row=mysql_fetch_array($result))
  {
   $Pro_Id=$row['Programme_Id'];
  $res=mysql_query("SELECT * FROM programme WHERE Programme_Id='$Pro_Id'");
  if($rowp=mysql_fetch_array($res))
  {
  $p_name=$rowp['Programme_Name'];
  } 
$no_m_stu=$row['No_Of_Male_Students'];
$Gra=$row['Grade'];
$no_f_stu=$row['No_Of_Female_Students'];
$te_in_trai=$row['Teachers_In_Training'];
$tra_tea=$row['Trained_Teachers'];
$Sch_Id=$row['School_Id'];
$Year=$row['Year'];
$Required_Teachers=$row['Required_Teachers'];
?>
   <?php
   echo '<tr>';
        echo '<th width="200" height="29" scope="row" bgcolor="#3399CC">';
		echo "Programme Id:";
		echo '</th>';
        echo '<td width="144">';
		echo "<input type='text' name='Pro_Id' value='$Pro_Id'>";
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "School Id:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='Sch_Id' value='$Sch_Id'>";
		echo '</td>';
      echo '</tr>';
	      echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Grade:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='Grade' value='$Gra'>";
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th width="200" height="29" scope="row" bgcolor="#3399CC">';
		echo "Year:";
		echo '</th>';
        echo '<td width="144">';
		echo "<input type='text' name='Year' value='$Year'>";
		echo '</td>';
      echo '</tr>';
        echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of male students:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='No_Of_Male_Students' value='$no_m_stu'>";
		echo '</td>';
      echo '</tr>';
	  echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of female students:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='No_Of_Female_Students' value='$no_f_stu'>";
		echo '</td>';
      echo '</tr>';
	   echo '<tr>';
        echo '<th width="200" height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of required teachers:";
		echo '</th>';
        echo '<td width="144">';
		echo "<input type='text' name='Required_Teachers' value='$Required_Teachers'>";
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of teachers in training:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='Teachers_In_Training' value='$te_in_trai'>";
		echo '</td>';
		 echo '</tr>';
      echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of trained teachers :";
		echo '</th>';
       echo '<td>';
	   echo "<input type='text' name='Trained_Teachers' value='$tra_tea'>";
	   echo '</td>';
      echo '</tr>';
     echo '<tr>';
       echo '<th height="29" scope="row" bgcolor="#3399CC">';
	   echo "Availability of books:"; 
	    echo '</th>';
       echo '<td bgcolor="#3399CC">';
	  
	   if($row['Availability_Books']=="Yes")
		   {
           echo '<input type="radio" name="Avai_Book" value="Yes" checked="checked"/>';
		    echo "Yes";
			echo '<input type="radio" name="Avai_Book" value="No"/>';
		    echo "No";
		   }
               
           echo "<br />";
		   if($row['Availability_Books']=="No")
		   {
			   echo '<input type="radio" name="Avai_Book" value="Yes"/>';
		    echo "Yes";
           echo '<input type="radio" name="Avai_Book" value="No" checked="checked"/>';
		    echo "No";
		   }
		   echo "<br />";
		 echo '</td>';
     echo '</tr>';
     echo '<tr>';
       echo '<th height="44" scope="row" bgcolor="#3399CC">';
	   echo "Availability of teachers guides:"; 
	    echo '</th>';
       echo '<td bgcolor="#3399CC">';
	   
	    if($row['Availability_Tguides']=="Yes")
		   {
           echo '<input type="radio" name="Avai_Tea_Gui" value="Yes" checked="checked"/>';
		    echo "Yes";
			echo '<input type="radio" name="Avai_Tea_Gui" value="No"/>';
		    echo "No";
		   }
             echo "<br />";
		   if($row['Availability_Tguides']=="No")
		   {
			   echo '<input type="radio" name="Avai_Tea_Gui" value="Yes"/>';
		    echo "Yes";
           echo '<input type="radio" name="Avai_Tea_Gui" value="No" checked="checked"/>';
		    echo "No";
		   }
		 echo '</td>';
     echo '</tr>';
}
   echo '</table>';
   echo "<br/>";
   echo '<input name="SaveChanges" align="middle" type="submit" value="Save changes" class="buttonok"/>';	
   }
	}
	}
	}
	 else if($_SESSION['Access_Type']=="Administrator")
{
   $result=mysql_query("SELECT * FROM programmes WHERE Programme_Id='$P_Id' AND School_Id='$S_Id' AND Year='$year'");
   if(mysql_num_rows($result)!=0)
	{
  echo '<table width="354" border="0" class="tablefontv">';
 while($row=mysql_fetch_array($result))
  {
  $Pro_Id=$row['Programme_Id'];
  $res=mysql_query("SELECT * FROM programme WHERE Programme_Id='$Pro_Id'");
  if($rowp=mysql_fetch_array($res))
  {
  $p_name=$rowp['Programme_Name'];
  }   
$no_m_stu=$row['No_Of_Male_Students'];
$no_f_stu=$row['No_Of_Female_Students'];
$Gra=$row['Grade'];
$te_in_trai=$row['Teachers_In_Training'];
$tra_tea=$row['Trained_Teachers'];
$Sch_Id=$row['School_Id'];
$Year=$row['Year'];
$Required_Teachers=$row['Required_Teachers'];
?>
   <?php
   echo '<tr>';
        echo '<th width="200" height="29" scope="row" bgcolor="#3399CC">';
		echo "Programme Id:";
		echo '</th>';
        echo '<td width="144">';
		echo "<input type='text' name='Pro_Id' value='$Pro_Id'>";
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "School Id:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='Sch_Id' value='$Sch_Id'>";
		echo '</td>';
      echo '</tr>';
	    echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Grade:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='Grade' value='$Gra'>";
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th width="200" height="29" scope="row" bgcolor="#3399CC">';
		echo "Year:";
		echo '</th>';
        echo '<td width="144">';
		echo "<input type='text' name='Year' value='$Year'>";
		echo '</td>';
      echo '</tr>';
           echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of male students:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='No_Of_Male_Students' value='$no_m_stu'>";
		echo '</td>';
      echo '</tr>';
	  echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of female students:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='No_Of_Female_Students' value='$no_f_stu'>";
		echo '</td>';
      echo '</tr>';
	   echo '<tr>';
        echo '<th width="200" height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of required teachers:";
		echo '</th>';
        echo '<td width="144">';
		echo "<input type='text' name='Required_Teachers' value='$Required_Teachers'>";
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of teachers in training:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='Teachers_In_Training' value='$te_in_trai'>";
		echo '</td>';
		 echo '</tr>';
      echo '<tr>';
        echo '<th height="29" scope="row" bgcolor="#3399CC">';
		echo "Number of trained teachers :";
		echo '</th>';
       echo '<td>';
	   echo "<input type='text' name='Trained_Teachers' value='$tra_tea'>";
	   echo '</td>';
      echo '</tr>';
     echo '<tr>';
       echo '<th height="29" scope="row" bgcolor="#3399CC">';
	   echo "Availability of books:"; 
	    echo '</th>';
       echo '<td bgcolor="#3399CC">';
	  
	   if($row['Availability_Books']=="Yes")
		   {
           echo '<input type="radio" name="Avai_Book" value="Yes" checked="checked"/>';
		    echo "Yes";
			echo '<input type="radio" name="Avai_Book" value="No"/>';
		    echo "No";
		   }
               
           echo "<br />";
		   if($row['Availability_Books']=="No")
		   {
			   echo '<input type="radio" name="Avai_Book" value="Yes"/>';
		    echo "Yes";
           echo '<input type="radio" name="Avai_Book" value="No" checked="checked"/>';
		    echo "No";
		   }
		 echo "<br />";
		echo '</td>';
     echo '</tr>';
     echo '<tr>';
       echo '<th height="44" scope="row" bgcolor="#3399CC">';
	   echo "Availability of teachers guides:"; 
	    echo '</th>';
       echo '<td bgcolor="#3399CC">';
	   if($row['Availability_Tguides']=="Yes")
		   {
           echo '<input type="radio" name="Avai_Tea_Gui" value="Yes" checked="checked"/>';
		    echo "Yes";
			echo '<input type="radio" name="Avai_Tea_Gui" value="No"/>';
		    echo "No";
		   }
          echo "<br />";
		   if($row['Availability_Tguides']=="No")
		   {
			   echo '<input type="radio" name="Avai_Tea_Gui" value="Yes"/>';
		    echo "Yes";
           echo '<input type="radio" name="Avai_Tea_Gui" value="No" checked="checked"/>';
		    echo "No";
		   }
		   echo '</td>';
     echo '</tr>';

   }
   echo '</table>';
   echo "<br/>";
   echo '<input name="SaveChanges" align="middle" type="submit" value="Save changes" class="buttonok"/>';	
   }
}
   }
 }
?>
</div>
</form>
 <div id="righttablereg">
  <div class="suggestionListsch" id="List"></div></div>
</div>
</div></div>
<div id="sidebar">
<br/>
<div id="partners" class="boxed">
			<h2 class="title">PROGRAMMES</h2>
            </div> 
<?php
include_once "menu.php";
?>
<?php
include_once "../footer.php";
?>
<?php

}
?>
</body>
</html>